package net.cmkj.mine.core.admin.sys.log;

import com.jfinal.plugin.activerecord.Page;

import net.cmkj.mine.bean.SysLog;
import net.cmkj.mine.common.anno.RequiresPermissions;
import net.cmkj.mine.common.controller.BaseController;
import net.cmkj.mine.common.model.DataGridModel;
import net.cmkj.mine.util.DataGridModelUtils;

public class LogController extends BaseController {
	
	private SysLog dao = SysLog.dao;
	
	@RequiresPermissions(value={"/sys/log"}) 
	public void index() {
		render("log.html");
	}
	
	/**
	 * 获取日志列表
	 */
	@RequiresPermissions(value={"/sys/log"})
	public void getList() throws Exception {
		String class_name=this.getPara("class_name");
		Page<SysLog> pageInfo = dao.paginate(getPage(), this.getRows(), class_name, this.getOrderby());
		DataGridModel result = DataGridModelUtils.toDataGridView(pageInfo);
		renderJson(result);
	}

}
